package xyz.thoughtset.viewer.modules.step.entity.block;

import cn.zhxu.bs.bean.DbIgnore;
import com.baomidou.mybatisplus.annotation.OrderBy;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import xyz.thoughtset.viewer.common.core.entity.BaseMeta;
import xyz.thoughtset.viewer.common.core.entity.IdMeta;
import xyz.thoughtset.viewer.common.crud.core.annotation.ApiCRUDPower;

import java.util.Date;
import java.util.List;
import java.util.Objects;

@TableName
@Data
@AllArgsConstructor
@NoArgsConstructor
//@ApiCRUDPower(insert = false,save = true,update = false,list = true)
public class BlockBodyEle extends BaseMeta {
    protected String paramsPayload;
    protected String eleId;
    private String type;
//    protected Date version;
//    private Boolean loop;
    protected String valNum;

    @TableField(exist = false)
    @DbIgnore
    private transient List<EleParam> params;

//    public boolean resultWasSingle() {
//        return Objects.nonNull(single) && single.booleanValue();
//    }

    public boolean eleWasFun() {
        return "funInfo".equalsIgnoreCase(type);
    }

}
